class creation_menu :
    def __init__ ( self , mediator ) :
        self . _awake = False
        self . _mediator = mediator
        self . _entry_text_in_browser = None
    def entry_text_in_browser_reply ( self , text ) :
        self . _entry_text_in_browser = text
    def show_creation_menu ( self ) :
        self . _awake = True
        self . _mediator . configure_title_text_for_browser ( self . _mediator . localization_creation_menu_title ( ) )
        self . _mediator . configure_action_text_for_browser ( self . _mediator . localization_creation_menu_create ( ) )
        self . _mediator . configure_action_title_name_text_for_browser ( self . _mediator . localization_creation_menu_new_name ( ) )
        self . _mediator . configure_only_unique_names_mode_for_browser ( self . _mediator . localization_creation_menu_already_exists ( ) )
        self . _mediator . configure_title_text_when_no_entries_for_browser ( self . _mediator . localization_creation_menu_title ( ) )
        self . _mediator . configure_keep_action_part_when_no_entries_for_browser ( )
        self . _mediator . show_browser ( )
    def hide_creation_menu ( self ) :
        self . _awake = False
        self . _mediator . hide_browser ( )
    def on_browser_return ( self ) :
        if self . _awake :
            self . _mediator . on_creation_menu_return ( )
    def on_browser_action ( self ) :
        if self . _awake :
            self . _mediator . entry_text_in_browser_request ( )
            kb_name = self . _entry_text_in_browser
            self . _mediator . create_knowledge_base ( kb_name )
            self . _mediator . select_knowledge_base_for_editing ( kb_name )
            self . _mediator . on_creation_menu_base_created ( )
